<?php

class User_Model_CharacterRow extends Zend_Db_Table_Row_Abstract
{
    /**
     * gets all the role - raider rank assiciations for this character
     * @return array(role_id => array(role_name, raider_rank_id, raider_rank))
     */
    public function getRaiderRanks()
    {   
        $charsRolesRanks = $this->findDependentRowset('User_Model_CharactersRolesRaiderRanks','Characters');
        $result = array();
        foreach ($charsRolesRanks as $crr){
            $result[$crr->role_id] = array(
                'role_name'     => $crr->findParentRow('User_Model_Roles','Roles')->role,
                'raider_rank_id'=> $crr->raider_rank_id,
                'raider_rank'   => $crr->findParentRow('User_Model_RaiderRanks','RaiderRanks')->rank
            );
        }
        return $result;
    }
}